package com.tpddns.flannery.flanneryscreenshots;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.v7.view.menu.ActionMenuItem;

public class MyApplication extends Application {

    public static Activity mActivityInstance;

    @Override
    public void onCreate() {
        super.onCreate();
        registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
            @Override
            public void onActivityCreated(Activity activity, Bundle bundle) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivityStarted(Activity activity) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivityResumed(Activity activity) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivityPaused(Activity activity) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivityStopped(Activity activity) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
                mActivityInstance = activity;
            }

            @Override
            public void onActivityDestroyed(Activity activity) {
                mActivityInstance = activity;
            }
        });
    }
}
